# the minimum version of CMake.
cmake_minimum_required(VERSION 3.5.0)
project(md360player)

set(NATIVERENDER_ROOT_PATH ${CMAKE_CURRENT_SOURCE_DIR})

if(DEFINED PACKAGE_FIND_FILE)
    include(${PACKAGE_FIND_FILE})
endif()

include_directories(${NATIVERENDER_ROOT_PATH}
                    ${NATIVERENDER_ROOT_PATH}/include)


aux_source_directory(${NATIVERENDER_ROOT_PATH}/napi md_napi)
aux_source_directory(${NATIVERENDER_ROOT_PATH}/vrlib md_vrlib)
aux_source_directory(${NATIVERENDER_ROOT_PATH}/vrlib/device md_vrlib_device)

# 排除 napi/napi_init.cc，因为我们已经使用根目录的 napi_init.cpp
list(REMOVE_ITEM md_napi "${NATIVERENDER_ROOT_PATH}/napi/napi_init.cc")

set(md_src_files
    ${md_napi}
    ${md_vrlib}
    ${md_vrlib_device}
    ${NATIVERENDER_ROOT_PATH}/napi_init.cpp
)

add_library(md360player SHARED ${md_src_files})
target_link_libraries(md360player PUBLIC
    libace_napi.z.so
    hilog_ndk.z
    libEGL.so
    libGLESv3.so
    libnative_image.so
    libnative_window.so)

